exports.answerComment = (req,res)=> { 
    /*
       @params: commentText:回复评论的内容
	   @params: author：回复评论的作者，
	   @params: id: 评论的文章
	   @return      
    */
    let comment = global.dbHelper.getModel('comment');  
    if(req.method == 'POST'){
		let commentText = req.body.commentText,
	        author = req.body.author,    
	        id = req.body.id ;   

            
		let time = new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate()+' '+new Date().getHours()+':'+new Date().getMinutes()+':'+new Date().getSeconds();
		   
	    comment.create({
	    	commentText : commentText,
	        author : author,
	        id : id,
	        time : time,
	       
	    },(error,doc) =>{
	        if(error){
		 	 	logger.error("回復评论创建失败:"+error)
		 	 	res.json({
		 	 		"code": 500,
		 	 		"msg":"回復评论失败"
		 	 	})
		 	 }else{
		 	 	res.json({
		 	 		"code": 200,
		 	 		"msg": "回復评论成功"
		 	 	})
		 	}   
	    })
     }else{
	        let id = req.query.id;

	        comment.find({
		    	id : id,
		    },(error,doc) =>{
		        if(error){
			 	 	logger.error("查找评论失败:"+error)
			 	 	res.json({
			 	 		"code": 500,
			 	 		"msg":"查找评论失败"
			 	 	})
			 	}else{
			 	 	res.json({
			 	 		"code": 200,
			 	 		"msg": "查找评论成功",
			 	 		"result": doc
			 	 	})
			    }   

			})

   		}
}